package com.emre.daoGenerator;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.beanutils.BeanUtils;

import com.emre.daoGenerator.bean.BeanClassGenerator;
import com.emre.daoGenerator.bean.BeanDefinition;
import com.emre.daoGenerator.beanExtractor.BeanExtractorClassGenerator;
import com.emre.daoGenerator.beanRowMapper.BeanRowMapperClassGenerator;
import com.emre.daoGenerator.deneme.CihazBean;
import com.emre.daoGenerator.objectClass.ObjectClassGenerator;
import com.emre.daoGenerator.oracleObject.Field;
import com.emre.daoGenerator.oracleObject.ObjectDefinition;
import com.emre.daoGenerator.oracleObject.OracleDataType;

public class TestClass 
{
	@SuppressWarnings("unused")
	public static void main(String[] args) 
	{		
		BeanDefinition beanDefinition = new BeanDefinition("CihazBean");
		
		List<Field> fields = new ArrayList<Field>();
		fields.add(new Field(OracleDataType.NUMBER, "id"));
		fields.add(new Field(OracleDataType.VARCHAR2, "name"));
		fields.add(new Field(OracleDataType.TIMESTAMP, "guncellemeZamani"));
		
		beanDefinition.setFields(fields);
		
		BeanClassGenerator gen = new BeanClassGenerator(beanDefinition, "D:\\");
		try 
		{
			gen.generate();
		} 
		catch (IOException e) 
		{
			e.printStackTrace();
		}
		
		BeanExtractorClassGenerator gen2 = new BeanExtractorClassGenerator(beanDefinition, "D:\\");
		try 
		{
			gen2.generate();
		} 
		catch (IOException e) 
		{
			e.printStackTrace();
		}
		
		BeanRowMapperClassGenerator gen3 = new BeanRowMapperClassGenerator(beanDefinition, "D:\\");
		try 
		{
			gen3.generate();
		} 
		catch (IOException e) 
		{
			e.printStackTrace();
		}
		
	}
}
